/*
 * @Author: baoshijie baoshijie
 * @Date: 2023-01-10 09:35:58
 * @LastEditors: baoshijie
 * @LastEditTime: 2024-04-07
 * @FilePath: \bridge_web\src\api\login.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request'
// 
// sso
// 根据ticket值登录
export function doLoginByTicket(data) {
  return request({
    url: '/sso/doLoginByTicket',
    method: 'post',
    data: data,
  })
}
// 获取登录地址
export function goSsoAuthUrl(data) {
  return request({
    url: '/sso/getSsoAuthUrl',
    method: 'post',
    data: data,
  })
}

// 获取当前用户菜单信息
export function getmenu() {
  return request({
    url: '/sso/getmenu',
    method: 'get',
  })
}
// sso
// 修改密码
export function ssoUseChangePassWord(data) {
  return request({
    url: $API.changePassWord,
    method: 'post',
    data: data,
  })
}
// 登录方法
export function login(username, password, code, uuid) {
  return request({
    url: $API.login,
    headers: {
      isToken: false,
    },
    method: 'post',
    data: { username, password, code, uuid },
  })
}


// 刷新方法
export function refreshToken() {
  return request({
    url: $API.refresh,
    method: 'post',
  })
}

// 获取用户详细信息
export function getInfo() {
  return request({
    url: '/sso/getuser',
    method: 'get',
  })
}

// 退出方法
export function logout() {
  return request({
    url: $API.logout,
    method: 'delete',
  })
}

// 获取验证码
export function getCodeImg() {
  return request({
    url: $API.code,
    headers: {
      isToken: false,
    },
    method: 'get',
    timeout: 20000,
  })
}
// 获取airlineCompany值
export function getAirlineCompany() {
  return request({
    url:'/sso/org',
    method: 'get',
  })
}